package com.yx.robot.bean.robot;


public class Furniture {
    /**
     * 0x0100 门
     * 0x0200 床
     * 0x0300 沙发
     * 0x0400 桌子
     * 0x0500 椅子
     * 0x0600 衣柜
     * 0x0700 马桶
     * 0x0800 地毯
     * 0x0900 洗衣机
     * 0x0A00 电视
     * 0x0B00 冰箱
     */
    int id;
    String name;
    int type;
    float x;
    float y;
    float width;
    float height;
    float similarity;
    float scale = 1f;
    float rotation;

    public Furniture() {

    }

    private Furniture(Builder builder) {
        id = builder.id;
        name = builder.name;
        type = builder.type;
        scale = builder.scale;
        x = builder.x;
        y = builder.y;
        rotation = builder.rotation;
        similarity = builder.similarity;
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public float getX() {
        return x;
    }

    public void setX(float x) {
        this.x = x;
    }

    public float getY() {
        return y;
    }

    public void setY(float y) {
        this.y = y;
    }

    public float getScale() {
        return scale;
    }

    public void setScale(float scale) {
        this.scale = scale;
    }

    public float getRotation() {
        return rotation;
    }

    public void setRotation(float rotation) {
        this.rotation = rotation;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public float getWidth() {
        return width;
    }

    public void setWidth(float width) {
        this.width = width;
    }

    public float getHeight() {
        return height;
    }

    public void setHeight(float height) {
        this.height = height;
    }

    public float getSimilarity() {
        return similarity;
    }

    public void setSimilarity(float similarity) {
        this.similarity = similarity;
    }

    public static final class Builder {
        private int id;
        private String name;
        private int type;
        private int x;
        private int y;
        private float scale = 1f;
        private float rotation;
        private float similarity;

        private Builder() {
        }

        public Builder id(int id) {
            this.id = id;
            return this;
        }

        public Builder type(int type) {
            this.type = type;
            return this;
        }

        public Builder position(int x, int y) {
            this.x = x;
            this.y = y;
            return this;
        }

        public Builder rotation(int rotation) {
            this.rotation = rotation;
            return this;
        }

        public Builder scale(float scale) {
            this.scale = scale;
            return this;
        }

        public Builder name(String name) {
            this.name = name;
            return this;
        }

        public Builder similarity(float similarity) {
            this.similarity = similarity;
            return this;
        }

        public Furniture build() {

            return new Furniture(this);
        }
    }
}
